ENT.Base = "base_point"
ENT.Type = "point"

function ENT:AcceptInput (name, activator, caller)
	printd ("input (" .. (name or "") .. ")", "activator", activator, "caller", caller)
	if name == "givecredit" then
		--printd (activator, caller)
		local amt = self:GetKeyValue ("amount", 100)
		local vec = nil
		--printd (self.pluspopup)
		if self:GetKeyValue ("pluspopup", 0) == 1 then
			vec = self:GetPos()
			--printd (vec)
		end
		if IsValid (activator) and activator:IsPlayer() then
			GAMEMODE:GiveCredits (activator, amt, vec)
		else
			for _,ply in pairs (player.GetAll()) do
				GAMEMODE:GiveCredits (ply, amt, vec)
			end
		end
	end
end

function ENT:GetKeyValue( key, default )
	if ( !self.KeyValues || !self.KeyValues[ key ] ) then return default end
	return self.KeyValues[ key ]
end

function ENT:KeyValue( key, value )
	self.KeyValues = self.KeyValues or {}
	self.KeyValues[ key ] = tonumber(value) or value
end
